package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysProcurementdeclareMapper;
import com.ruoyi.system.domain.SysProcurementdeclare;
import com.ruoyi.system.service.ISysProcurementdeclareService;
import com.ruoyi.common.core.text.Convert;

/**
 * 采购申报实体Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-12-13
 */
@Service
public class SysProcurementdeclareServiceImpl implements ISysProcurementdeclareService 
{
    @Autowired
    private SysProcurementdeclareMapper sysProcurementdeclareMapper;

    /**
     * 查询采购申报实体
     * 
     * @param procurementDeclareId 采购申报实体ID
     * @return 采购申报实体
     */
    @Override
    public SysProcurementdeclare selectSysProcurementdeclareById(Long procurementDeclareId)
    {
        return sysProcurementdeclareMapper.selectSysProcurementdeclareById(procurementDeclareId);
    }

    /**
     * 查询采购申报实体列表
     * 
     * @param sysProcurementdeclare 采购申报实体
     * @return 采购申报实体
     */
    @Override
    public List<SysProcurementdeclare> selectSysProcurementdeclareList(SysProcurementdeclare sysProcurementdeclare)
    {
        return sysProcurementdeclareMapper.selectSysProcurementdeclareList(sysProcurementdeclare);
    }

    /**
     * 新增采购申报实体
     * 
     * @param sysProcurementdeclare 采购申报实体
     * @return 结果
     */
    @Override
    public int insertSysProcurementdeclare(SysProcurementdeclare sysProcurementdeclare)
    {
        sysProcurementdeclare.setCreateTime(DateUtils.getNowDate());
        return sysProcurementdeclareMapper.insertSysProcurementdeclare(sysProcurementdeclare);
    }

    /**
     * 修改采购申报实体
     * 
     * @param sysProcurementdeclare 采购申报实体
     * @return 结果
     */
    @Override
    public int updateSysProcurementdeclare(SysProcurementdeclare sysProcurementdeclare)
    {
        return sysProcurementdeclareMapper.updateSysProcurementdeclare(sysProcurementdeclare);
    }

    /**
     * 删除采购申报实体对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteSysProcurementdeclareByIds(String ids)
    {
        return sysProcurementdeclareMapper.deleteSysProcurementdeclareByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除采购申报实体信息
     * 
     * @param procurementDeclareId 采购申报实体ID
     * @return 结果
     */
    @Override
    public int deleteSysProcurementdeclareById(Long procurementDeclareId)
    {
        return sysProcurementdeclareMapper.deleteSysProcurementdeclareById(procurementDeclareId);
    }

    @Override
    public SysProcurementdeclare findProjectNumber(String year) {
        return sysProcurementdeclareMapper.findProjectNumber( year);
    }
}
